<template>
  <div class="photoList">
    <van-tabs v-model="activeTab">
      <van-tab :title="item.title" v-for="item in cateList" :key="item.id">{{item.title}}</van-tab>
    </van-tabs>
  </div>
</template>

<script>
import { getimgcategory } from '@/api/photo'
export default {
  data () {
    return {
      // 所有的分类项
      cateList: [],
      // 选中当前tab项
      activeTab: '',
      // 当前分类项中的数据
      curData: []
    }
  },
  created () {
    this.getimgcategory();
  },
  methods: {
    async  getimgcategory () {
      const res = await getimgcategory()
      this.cateList = res.data.message;
    }
  }
}
</script>

<style lang="scss">
.photoList {
  .van-tab {
    width: 75px;
  }
}
</style>